﻿@model IEnumerable<Common.Views.UserOrderDetailsView>

@{
    ViewBag.Title = "OrderDetails";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Order Details</h2>

<table>
    <tr>
        <th>
            Product Name
        </th>
        <th>
            Quantity
        </th>
        <th>
            Price
        </th>
        <th>
            Warranty Expiry Date
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
    @Html.HiddenFor(model=> item.OID)
        <td>
            @Html.DisplayFor(modelItem => item.ProductName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Quantity)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Price)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ExpiryDate)
        </td>
        @Html.HiddenFor(modelItem => item.ProductID)
        <td>
            @Html.ActionLink("Post comment", "PostComment", new { id=item.ProductID }) |
            @Html.ActionLink("Rate Product", "RateProduct", new { id=item.ProductID}) |
            @Html.ActionLink("Report Fault", "../Fault/SubmitFault", new {oID=item.OID ,id=item.ProductID, date=item.ExpiryDate}) |
            @Html.ActionLink("View This Product Fault Details", "MyFaults", new { id=item.ProductID })
        </td>
    </tr>
    <tr>
    <td>
    @Html.ActionLink("Print This Order and send by email", "PrintOrderAndSend", new { id = item.OID }) 
    </td>
    </tr>
}

</table>


